" Vim syntax file " Language: STIL " Maintainer: " Filenames: *.stil " Last Change: 24th April 2002 " URL: http://www.netcomuk.co.uk/~mrw/vim/syntax " For version 5.x: Clear all syntax items " For version 6.x: Quit when a syntax file was already loaded if version < 600 syntax clear elseif exists("b:current_syntax") finish endif "syn match stilSpecialChar "[!@#$%^&\*()-+=|`~{[}\]:;',<.>/?\\]" " STIL comments syn keyword stilTodo contained TODO FIXME XXX syn region stilComment start="/\*" end="\*/" contains=stilTodo syn match stilComment "//.*$" contains=stilTodo " STIL number forms syn match stilInteger "-\d\+" syn match stilInteger "\<\d\+" syn match stilHex "\<\x\+\>" contains=stilEngUnits syn match stilDecimal "-\=\d\+\.\d\+" syn match stilDecimal "-\=\d\+e-\=\d\+" syn match stilDecimal "-\=\d\+\.\d\+e-\=\d\+" " STIL engineering units syn match stilEngUnits "[EPTGMkmunpfa]\=\(A\|Cel\|F\|H\|Hz\|m\|Ohm\|s\|W\|V\)\>" " STIL identifiers syn match stilIdentifier "\<\h\w*\>" syn match stilDomain "\<\h\w*\>\s\+{"me=e-1 " STIL strings syn match stilStringDelim +"+ syn region stilString matchgroup=stilStringDelim start=+"+ end=+"+ " STIL annotations (highlighted as String) syn match stilAnnDelim "\]" syn match stilLogicalOperator "[!<>]=" " try comment handling from c if exists("c_comment_strings") " A comment can contain cString, cCharacter and cNumber. " But a "*/" inside a cString in a cComment DOES end the comment! So we " need to use a special type of cString: cCommentString, which also ends on " "*/", and sees a "*" at the start of the line as comment again. " Unfortunately this doesn't very well work for // type of comments :-( syntax match cCommentSkip contained "^\s*\*\($\|\s\+\)" syntax region cCommentString contained start=+L\=\\\@= 508 || !exists("did_stil_syntax_inits") if version < 508 let did_stil_syntax_inits = 1 command -nargs=+ HiLink hi link else command -nargs=+ HiLink hi def link endif HiLink stilTodo Todo HiLink stilComment Comment HiLink stilComment Comment HiLink stilInteger Number HiLink stilHex Number HiLink stilDecimal Float HiLink stilStringDelim Delimiter HiLink stilString String HiLink stilAnnDelim Delimiter HiLink stilAnn String HiLink stilSigExprOp Operator HiLink stilSigExprDelim Delimiter HiLink stilSigExpr String HiLink stilIdentifier Identifier HiLink stilDomain Function HiLink stilStatement Statement HiLink stilRepeat Repeat HiLink stilSpecialChar Special HiLink stilMathOperator Operator HiLink stilLogicalOperator Operator HiLink stilEngUnits PreProc delcommand HiLink endif let b:current_syntax = "stil"